import React from 'react';
import { Pagination } from 'antd';

class Paging extends React.Component {
  state = {
  };

 
  render(){

    const defaultProps={
      showSizeChanger:true,
      showQuickJumper:true,
      current:this.props.formValues.pageNum,
      defaultPageSize:10,
      showTotal:total => `共 ${total} 条数据`,
      onChange:(pageNum,pageSize)=>{
        this.props.fetch({...this.props.formValues,...{pageNum,pageSize}})
      },
      onShowSizeChange:(pageNum,pageSize)=>{
        this.props.fetch({...this.props.formValues,...{pageNum,pageSize}})
      },
      total:this.props.total
    }
  
    return(
      <Pagination style={{width:'100%',textAlign:'center',marginTop:10}} {...defaultProps} />
    )
  }
}
export default  Paging;